using System;
using System.Collections;
using System.Security.Principal;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using NHibernate.Expression;

namespace DecisionesInteligentes.iEvalua.Models
{
	/// <summary>
	/// An instance of this class represents a Role.
	/// </summary>
	[ActiveRecord("Roles")]
	public class Role : ActiveRecordValidationBase<Role>, IEntity{
		
		#region Persistent properties
		[PrimaryKey]
		public int Id {
			get;
			set;
		}
		[Property]
		[ValidateNonEmpty("Name cannot be empty")]
		public string Name {
			get;
			set;
		}
		#endregion
		
		[BelongsTo("ApplicationId")]
		[ValidateNonEmpty("Application cannot be empty")]
		public Application Application
		{
			get;
			set;
		}
		
		public int GetId()
		{
			return Id;
		}
	}

}
